package com.bigShen.mybatis.official.factory.singleton;

import com.bigShen.mybatis.official.factory.SqlSessionFactorySingleton;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author : lei.shen
 * @date : 2018/11/21
 */
public class SingletonTest {

    public static void main(String[] args) {

        ExecutorService executorService = Executors.newFixedThreadPool(6);

        for (int i = 0; i <= 30; i++) {
            executorService.submit(new Runnable() {
                @Override
                public void run() {

                    //System.out.println(FactorySingleton.getInstance());
                    System.out.println(SqlSessionFactorySingleton.getSqlSessionFactoryInstance());
                    //System.out.println("-- ");
                }

            });
        }
        executorService.shutdown();
    }

}
